package com.bchun.gamepk.web;

import java.util.Map;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

/**
 * <pre>
 * FutureSoftware
 * 
 * File: AuthorizationInterceptor.java
 * 
 * Copyright (C) By PeterFeng at 2013
 * 
 * Description: 
 * 
 * Notes:
 * 
 * Revision History
 * Date          Name         Desc
 * 2013年9月20日         PeterFeng    Initial design
 * 
 * </pre>
 */
public class AuthorizationInterceptor extends AbstractInterceptor {

	private static final long serialVersionUID = 8207942211829610190L;

	@Override
	public String intercept(ActionInvocation ai) throws Exception {
		Map<String, Object> session = ai.getInvocationContext().getSession();
		if (null != session.get(SystemConstants.SESSION)) {
			return ai.invoke();
		} else {
			return "tosession";
		}
	}

}
